<template>
	<!-- 必到-首页 -->
	<view>
		<!-- 导航 -->

		<!-- <mescroll-body
			top="0"
			:down="downOption"
			:up="upOption"
			ref="mescrollRef"
			:fixed="true"
			height="100%"
			:height="comHeight"
			:topbar="false"
			bottom="0"
			:bottombar="true"
			:safearea="false"
			@init="mescrollInit"
			@down="downCallback"
		> -->
		<!-- 首页头部 -->

		<scroll-view :upper-threshold="50" :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltolower="lower">
			<view class="heard_bg" style="width: 100%;margin: auto;height: 644rpx;margin-bottom: 35rpx;">
				<u-navbar :height="navHeight" :background="false" :is-back="false" title="必到家政" title-color="#ffffff" :title-bold="true" :border-bottom="false">
					<!-- 	<view class="city" @click="jumpToSelectCity">
		        			<text class="leftTest">{{ siteName }}</text>
		        			<u-icon name="arrow-down" color="#3F3F3F" size="28"></u-icon>
		        		</view> -->
				</u-navbar>
				<view style="width: 95%;margin: auto;display: flex;justify-content: space-between;align-items: center;padding-top: 10rpx;">
					<view @tap.stop="serach()" style="width: 88%;background-color: white; height: 66rpx;border: 1rpx solid #fff;border-radius: 33rpx;position: relative;">
						<view style="width: 100%;display: flex;align-items: center;">
							<image style="width: 26rpx;height: 32rpx;margin: 0rpx 10rpx 0rpx 15rpx;" src="../../static/gx_img/dw_icon.png"></image>
							<view style="width: 120rpx;font-size: 26rpx;line-height: 66rpx; color: #000000;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">
								{{siteName}}}
							</view>
							<view style="height:34rpx ;width: 1rpx;background-color:#D2D2D2 ;margin-right: 18rpx;"></view>
							<u-icon name="search" color="#D2D2D2" size="28"></u-icon>
							<view style="font-size: 26rpx;color: #E4E4E4;margin-left: 10rpx;">日常保洁</view>
						</view>
						<view
							style="top: 2rpx;right: 2rpx;color: white; position: absolute; border-radius: 32rpx; text-align: center;line-height: 58rpx; width:106rpx;height: 58rpx;background: linear-gradient(327deg, #F83011 0%, #FF9900 100%);font-size: 26rpx;"
						>
							搜索
						</view>
					</view>
					<image style="width: 42rpx;height: 42rpx;" src="../../static/gx_img/news_icon.png"></image>
				</view>
				<view style="width: 95%;margin: auto;display: flex;padding: 22rpx 0rpx 30rpx 0rpx;">
					<view
						v-for="(item, index) in icon"
						:key="index"
						style="margin-right: 20rpx; display: inline-block; border: 1px solid #FFFFFF;padding: 2rpx 15rpx;border-radius: 30rpx;background: rgba(255, 255, 255, 0.35);"
					>
						<image v-if="index == 0" style="width: 24rpx;height: 28rpx;margin-right: 20rpx;" src="../../static/gx_img/hotwhite_icon.png"></image>
						<text style="font-family: SFProText-Semibold;font-size: 26rpx;color: #FFFFFF;">{{ item.name }}</text>
					</view>
				</view>
				<!-- 轮播图 -->
				<view style="width: 95%;margin: auto;border-radius: 20rpx;overflow: hidden;">
					<swiper class="slideshow" indicator-dots="true" indicator-color="#B2B2B2" indicator-active-color="#000000" autoplay="true" interval="5000" circular="true">
						<swiper-item style="border-radius: 20rpx;" v-for="(item, index) in slideShowList" :key="index" @click="jumpToBanner(item)">
							<image style="" :src="item.imageUrl" style="" mode="aspectFill"></image>
						</swiper-item>
					</swiper>
				</view>
			</view>

			<!-- 消息 -->
			<!-- <view class="information" v-if="messageCount != 0" @click="jumpToInfomation"><image src="../../static/img/1-2.png" style="width: 147rpx;height: 93rpx;"></image></view>
 -->

			<!-- 公告 -->
			<!--  -->
			<!-- <view v-if="noticeList.length>0" style="background-color:#FCF9EB;display: flex;flex-direction:row;" @click="jumpToNoticeList">
				<view style="margin-top: 10rpx; width: 170rpx;line-height:48rpx ;height: 48rpx; text-align: center;font-size: 30rpx;font-family: 
                  ZHSCNMT--GBK1-0;font-weight: bold;border-right:2rpx solid #F7CACA ;">
				
					<text style="color: #272755;">生活</text><text style="color: #FF0000;">   百科  </text>
					</view>
				<view style="width: 678rpx;">
					<u-notice-bar   mode="vertical" :duration="3500" color="#F67B7B" :volume-icon="false" bg-color="#FCF9EB" :list="noticeList"></u-notice-bar>
				</view>
			</view> -->
			<view
				style="  width: 95%;display: flex;align-items: center;justify-content: space-around; margin: auto;height: 40rpx;background: #FEEEEE;opacity: 1;border-radius:10rpx;"
			>
				<view style="display: flex;align-items: center;">
					<image style="width: 24rpx;height: 22rpx;margin-right: 8rpx;" src="../../static/gx_img/home_icon1.png"></image>
					<text style="color: #FF6D5D;font-size:20rpx ;">一站式家庭服务平台</text>
				</view>
				<view style="display: flex;align-items: center;">
					<image style="width: 16rpx;height: 18rpx;margin-right: 8rpx;margin-top: 2rpx;" src="../../static/gx_img/home_icon2.png"></image>
					<text style="color: #FF6D5D;font-size:20rpx ;">一站式家庭服务平台</text>
				</view>
				<view style="display: flex;align-items: center;">
					<image style="width: 20rpx;height: 22rpx;margin-right: 8rpx;margin-top: 2rpx;" src="../../static/gx_img/home_icon3.png"></image>
					<text style="color: #FF6D5D;font-size:20rpx ;">一站式家庭服务平台</text>
				</view>
			</view>

			<!-- 金刚区 -->

			<u-grid :col="4" :border="false">
				<view style="padding-top: 20rpx;">
					<u-grid-item v-for="(item, index) in classifyList" :custom-style="customStyle" @click="gojump(item)" :key="index" v-if="index < 4">
						<image class="" style="width: 90rpx;height: 90rpx;" :src="item.icon"></image>
						<view class="" style="color: #000000;font-size: 26rpx;margin-top: 14rpx;margin-bottom: 12rpx;">{{ item.name }}</view>
					</u-grid-item>
				</view>
			</u-grid>
			<view style="width: 100%;margin: auto;height: 4px;background: #F5F5F5;"></view>
			<u-grid :col="5" :border="false">
				<view style="padding-top: 16rpx;">
					<u-grid-item v-for="(item, index) in classifyList" :custom-style="customStyle" @click="gojump(item)" :key="index" v-if="index < 8">
						<image class="" style="width: 60rpx;height: 60rpx;" :src="item.icon"></image>
						<view class="" style="color: #000000;font-size: 26rpx;margin-top: 14rpx;margin-bottom: 12rpx;">{{ item.name }}</view>
					</u-grid-item>
				</view>
			</u-grid>
			<view
				style="width: 100%;margin: auto;height: 4px;
			background: #F5F5F5;"
			></view>
			<!-- 非她莫属 -->
			<view style="width: 95%;margin:auto;padding: 12rpx 0rpx;" @click="jumpToMatching">
				<image :src="noSheNoChooseImg" style="width:100%;height: 170rpx;border-radius: 20rpx;"></image>
			</view>
			<view
				style="width: 100%;margin: auto;height: 4px;
			background: #F5F5F5;"
			></view>
			<!-- 新版本热门服务 -->
			<view style="width: 100%;margin:12rpx auto;">
				<view style="width: 100%;display: flex;align-items: center;">
					<view style="width: 30%;"><image style="width:208rpx;height: 44rpx;display: block;margin-left: 12rpx;" src="../../static/img/rmfw.png"></image></view>
					<view style="width: 70%;display: flex;justify-content: space-between;">
						<view
							@tap="choose_id(item.id)"
							v-for="(item, index) in remen"
							:key="index"
							:class="item.id == choose_rm ? 'choose_1' : 'choose_2'"
							style="width: 33%;font-size: 26rpx;line-height: 78rpx;text-align: right;"
						>
							<text style="margin-right: 10rpx;margin-top:5rpx ;">{{ item.name }}</text>
						</view>
					</view>
				</view>
				<view style="background: linear-gradient(164deg, #FFAD5B 0%, #FF00B2 100%);padding: 20rpx 0rpx;">
					<view style="width: 95%;margin: auto;background-color: white;">
						<view class="unit" v-for="(ites, indes) in shopList" :key="indes" @click="shopDetail(ites.enterpriseId)">
							<view style="width: 95%;margin: auto;display: flex;">
								<view style="width:23% ;"><image class="" style="width: 146rpx;height: 132rpx;" :src="ites.portrait" mode="aspectFill"></image></view>
								<view style="width:77%;margin-top: -7rpx;">
									<view style="color: #3F3F3F;font-size: 30rpx;font-weight: 800;">{{ ites.name }}</view>
									<view style="display: flex;align-items: center;margin: 10rpx 0rpx;">
										<view style="color: #F29423;font-size: 26rpx;text-align: left;">{{ ites.score }}分</view>
										<image style="width:28rpx ;height: 26rpx;margin: 0rpx 10rpx 0rpx 20rpx;" src="../../static/gx_img/sjlist_2.png"></image>
										<view style="color: #000000;font-size: 26rpx;">已服务{{ ites.serviceTimes || '0' }}次</view>
									</view>
									<view style="display: flex;width: 100%;justify-content: space-between;">
										<view style="display: flex;font-size: 20rpx;width: 280rpx;border-radius: 10rpx;border: 1rpx solid #FF4B34;">
											<view style="text-align: center; width: 196rpx;height: 40rpx;background: #FF4B34;color: white;font-size: 20rpx;line-height: 40rpx;">
												百亿补贴家电清洗季
											</view>
											<view style="width: 84rpx;height: 40rpx;color:#FF3D00 ;text-align: center;line-height: 40rpx;">领券</view>
										</view>
										<view style="color:#989898;font-size: 26rpx;">{{ ites.region }}</view>
									</view>
								</view>
							</view>
							<view style="width: 95%;margin: auto;" v-for="(itt, ind) in ites.packageBisPageVOS" :key="ind">
								<view class="unit2">
									<view class="sales" :class="ind > 0 ? 'sa_bottoms' : ''" style="">
										<view style="display: flex;width: 100%;">
											<image src="../../static/icon/nears.png" mode="" style="width: 26rpx;height: 26rpx;margin-top: 10rpx;"></image>
											<view style="width: 100%;margin: auto;">
												<view class="hour" style="padding-left: 32rpx;">
													<view style="color: #F29423;font-size: 32rpx;font-weight: bold;">￥{{ itt.unitPrice }}</view>
													<view
														style="font-size: 30rpx;color: #9393AA;margin-left: 40rpx;overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;width: 400rpx;color: #000000;"
													>
														{{ itt.name }}
													</view>
													<!-- <view class="tao">套餐</view> -->
												</view>

												<view class="money">
													<view class="sale" style="padding-left: 12rpx;">
														<view class="prices">门市价：</view>
														<view class="prices">￥{{ itt.showPrice }}</view>
													</view>
													<view class="over" style="text-align: right;">已售{{ itt.totalSale }}</view>
												</view>
											</view>
										</view>
									</view>
								</view>
							</view>

							<view v-if="indes < shopList.length - 1" style="width: 100%;height:10rpx ; background-color: #F8F8F8;margin-top: 20rpx;"></view>
						</view>
					</view>
				</view>
				<view style="margin: 40rpx 0;" v-if="!showList">
					<u-divider color="#DEDEDE" half-width="120" border-color="#DEDEDE">{{ prompt }}</u-divider>
				</view>
			</view>

			<!-- 热门服务 -->
			<view class="tables" v-show="oneList.pName" style="width: 100%;margin: auto;">
				<view style="padding-top: 30rpx;width: 94%;margin: auto;padding-bottom: 12rpx;">
					<image style="width:184rpx;height: 38rpx;display: block;" src="../../static/img/rmfw.png"></image>
				</view>
				<view style="display: flex;flex-wrap:wrap;align-items: center;width: 99%;margin:0 auto;">
					<view style="width: 50%;margin:0 ;" v-for="(item, index) in oneList.business" :key="index">
						<image :src="item.icon" style="width: 370rpx;height: 188rpx; display: block;" @click="jumpToBusiness(item)"></image>
					</view>
				</view>
			</view>

			<!-- 超值推荐 -->
			<!-- <view class="tables" v-show="towList.pName">
				<view style="margin-left:30rpx;padding-top: 10rpx;">
					<text class="typeface1">{{towList.pName}}</text>
					<image src="../../static/img/1-6.png" style="width: 31rpx;height: 31rpx;vertical-align:middle;margin-left: 20rpx;"></image>
				</view>

				<view style="display: flex;flex-wrap:wrap;margin-top: 10rpx;width: 718rpx;margin-left:15rpx;padding-bottom: 34rpx;">
					<view style="width: 316rpx;margin:12rpx 15rpx;" v-for="(item,index) in towList.business" :key="index">
						<image :src="item.icon" style="width: 316rpx;height: 256rpx;" @click="jumpToBusiness(item)"></image>
					</view>

				</view>
			</view> -->
			<!-- 专业保姆 -->
			<view class="tables" v-show="threeList.pName" style="width: 100%;margin: auto;">
				<view style="padding-top: 30rpx;width: 94%;margin: auto;padding-bottom: 10rpx;">
					<image style="width:184rpx;height: 38rpx;display: block;" src="../../static/img/zybm.png"></image>
				</view>
				<!-- <view style="padding-top: 10rpx;width:94%;margin: auto;overflow: hidden;padding-bottom: 10rpx;">
					<image src="../../static/icon/zybm.png" style="float: left; width: 34rpx;height: 34rpx;vertical-align:middle;"></image>
					<image style="width: 136rpx;height: 38rpx;float: left;margin-left: 10rpx;" src="../../static/img/zybm.png"></image>
					
				</view> -->
				<view style="width: 96%;margin: auto;">
					<view style="display: flex;flex-wrap:wrap;align-items: flex-start;justify-content: space-between; padding-top: 4rpx;width: 100%;margin: auto;">
						<view style="width: 32%;margin:12rpx auto;" v-for="(item, index) in threeList.business" :key="index">
							<image :src="item.icon" style="width:100%;height: 287rpx;" @click="jumpToBusiness(item)"></image>
						</view>
					</view>
				</view>
			</view>
			<view style="width: 100%;height: 22rpx;background-color:#F0F0F0 ;"></view>
			<!-- 附近商家 -->
			<view class="tables" style="width: 100%;margin: auto;">
				<view style="padding-top: 30rpx;width: 94%;margin: auto;"><image style="width:184rpx;height: 38rpx;display: block;" src="../../static/img/fjsj.png"></image></view>

				<view class="unit" style="width: 100%;margin: auto;" v-for="(ites, indes) in shopList" :key="indes" @click="shopDetail(ites.enterpriseId)">
					<view style="width: 93%;margin: auto;">
						<view class="unit1" style="width: 100%;margin: auto;overflow: hidden;">
							<!-- <view class="img"> -->
							<view style="width: 23.5%;float: left;margin-top: 10rpx;">
								<image :src="ites.portrait" mode="aspectFill" style="width: 138rpx;height: 128rpx;" class="img"></image>
							</view>

							<!-- </view> -->
							<view class="shop" style="width: 76.5%;float: right;">
								<view class="all" style="">
									<view class="nam" style="width:100%;">{{ ites.name }}</view>
									<!-- <view class="year">
									{{ites.yearNum ||'0'}}年行业经验
								</view> -->
								</view>
								<view style="margin-top: 10rpx;">
									<!-- ites.score -->
									<u-rate
										size="26rpx"
										:count="count"
										v-bind:value.sync="ites.score"
										inactive-color="#E4E4E4"
										:disabled="true"
										inactive-icon="star-fill"
										active-color="#F29423"
									></u-rate>
									<text style="font-size: 22rpx; color: #F29423;padding-left: 10rpx;">{{ ites.score }}</text>
								</view>
								<view style="width: 100%;margin: auto;overflow: hidden;padding-top: 6rpx;">
									<view class="bott" style="float: left;">
										<view class="service" style="padding-left: 5rpx;">
											<image src="https://beedao.oss-cn-beijing.aliyuncs.com/1c46a3d2714b4edca4cbdc968f05aca5.png" mode=""></image>
											<view>已服务{{ ites.serverNum }}次</view>
										</view>
									</view>
									<view style="float: right;font-size: 26rpx;color: #9393AA;margin-top: 14rpx;">{{ ites.region }}</view>
								</view>
							</view>
						</view>
						<view v-for="(itt, ind) in ites.packageBisPageVOS" :key="ind">
							<view class="unit2">
								<view class="sales" :class="ind > 0 ? 'sa_bottoms' : ''">
									<view style="display: flex;width: 100%;">
										<image src="../../static/icon/nears.png" mode="" style="width: 26rpx;height: 26rpx;margin-top: 10rpx;"></image>
										<view style="width: 100%;margin: auto;">
											<view class="hour" style="padding-left: 32rpx;">
												<view style="color: #F29423;font-size: 32rpx;font-weight: bold;">￥{{ itt.unitPrice }}</view>
												<view
													style="font-size: 30rpx;color: #9393AA;margin-left: 40rpx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;width: 400rpx;"
												>
													{{ itt.name }}
												</view>
												<!-- <view class="tao">套餐</view> -->
											</view>

											<view class="money">
												<view class="sale" style="padding-left: 12rpx;">
													<view class="prices">门市价：</view>
													<view class="prices">￥{{ itt.showPrice }}</view>
												</view>
												<view class="over" style="text-align: right;">已售{{ itt.totalSale }}</view>
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
					<view style="width: 100%;margin: auto;height: 10rpx;background-color: #F0F0F0;"></view>
				</view>
				<view style="margin: 40rpx 0;" v-if="!showList">
					<u-divider color="#DEDEDE" half-width="120" border-color="#DEDEDE">{{ prompt }}</u-divider>
				</view>
			</view>
			<!-- 家电清洗 -->
			<!-- <view class="tables" style="margin-bottom: 20rpx;" v-show="fourList.pName">
				<view style="margin-left:30rpx;padding-top: 10rpx;"><text class="typeface1">{{fourList.pName}}</text></view>

				<view style="display: flex;flex-wrap:wrap;margin-top: 10rpx;padding-bottom: 34rpx;margin-left: 15rpx;">
					<view style="width: 222rpx;margin:12rpx 7rpx;" v-for="(item,index) in fourList.business" :key="index">
						<image :src="item.icon" style="width: 222rpx;height: 297rpx;" @click="jumpToBusiness(item)"></image>
					</view>
				</view>
			</view> -->

			<!-- <view style="margin-bottom: 20rpx;">
				<slider-range
				  :value="rangeValue"
				  :min="rangeMin"
				  :max="rangMax"
				  :step="5"
				  :bar-height="3"
				  :block-size="32"
				  :format="format"
				  @change="handleRangeChange"
				></slider-range>
			</view> -->
		</scroll-view>
		<!-- </mescroll-body> -->

		<u-toast ref="uToast" />
		<!-- 	<u-mask :show="show" @click="show = false">
			<view class="warp">
				<image src="../../static/icon/1-101.png" mode=""></image>
				<view  mode="" style="width: 42px;height: 42px;position: absolute;top: 70%;" @click="show = false">
					<u-icon name="close-circle" color="#f5f5f5" size="42"></u-icon>
				</view>
			</view>
		</u-mask> -->
		<!-- <u-tabbar :before-switch="beforeSwitch" v-model="current" :list="list" :mid-button="true"></u-tabbar> -->
		<!-- <my-footer tab="home"></my-footer> -->

	</view>
</template>

<script>
import SliderRange from '../primewind-sliderrange/components/primewind-sliderrange/index.vue';
import amap from '../../components/map/amap-wx.js';
// import myFooter from "@/components/fotter/myfooter.vue";
export default {
	components: {
		// myFooter,
		
		SliderRange
	},
	data() {
		return {
		
			background: {
				backgroundColor: '#ffffff'
			},
			remen: [
				{
					name: '月嫂护工',
					id: 0
				},
				{
					name: '家电维修',
					id: 1
				},
				{
					name: '家政保洁',
					id: 2
				}
			],
			choose_rm: 0,
			customStyle: {
				padding: '8rpx 0'
			},
			customStyles: {
				// backgroundColor: '#fca800',
			},
			icon: [{ name: '家电清洗' }, { name: '月嫂' }, { name: '保姆' }, { name: '育儿嫂' }],
			siteName: '', //地址
			slideShowList: [], //轮播图
			noticeList: [], //公告
			classifyList: [], //金刚区list
			oneList: {},
			towList: {},
			threeList: {},
			fourList: {},

			messageCount: 0,
			// 下拉刷新配置
			downOption: {
				use: true,
				auto: false,
				offset: 40
			},
			upOption: {
				use: true,
				auto: false
			},
			mescroll: null,

			rangeMin: 5,
			rangMax: 100,
			rangeValue: [10, 50],
			show: true, // 弹窗显示与隐藏
			count: 5,
			value: 3,
			page: 1,
			pageSize: 15,
			shopList: [],
			prompt: '',
			showList: false,
			totalPage: 1,
			noSheNoChooseImg: '',
			token: '',
			userinfo: '',
			comHeight: 0,
			navHeight: 0
		};
	},
	
	onReachBottom() {
		if (this.totalPage == this.page) {
			return false;
		} else {
			this.page += 1;
			// this.page = 1;
			this.getShop();
		}
	},
	computed() {
		var that = this;
		uni.showShareMenu();
		// this.show = true;
		var menuButtonInfo = uni.getMenuButtonBoundingClientRect();
		const { top, width, height, right } = menuButtonInfo;
		uni.getSystemInfo({
			success: res => {
				const statusBarHeight = res;
				const margin = top - statusBarHeight;
				var navHeight = height + statusBarHeight + margin * 4;
				that.navHeight = height + margin * 2;
				that.comHeight = res.windowHeight - navHeight + 'px';
			}
		});
		//缓存用户信息和token
		this.token = uni.getStorageSync('token');
		this.userinfo = uni.getStorageSync('userinfo');
		//判断是否登录
		// if (!token) {
		// 	uni.navigateTo({
		// 		url: '../login/login'
		// 	});
		// }
		this.getLocationInfo();
		this.getHomeData();
		this.getBusinessData();
		this.getShop();
	},
	scrolltoupper(e) {
		console.log(e);
		console.log('1568');
	},

	methods: {
		getData() {
			console.log('bss')
		//缓存用户信息和token
		this.token = uni.getStorageSync('token');
		this.userinfo = uni.getStorageSync('userinfo');
		//判断是否登录
		// if (!token) {
		// 	uni.navigateTo({
		// 		url: '../login/login'
		// 	});
		// }
		this.getLocationInfo();
		this.getHomeData();
		this.getBusinessData();
		this.getShop();
		},
		async beforeSwitch(index) {
			// await等待一个请求，请求回来后再返回true，再进行切换
			let data = await this.$u.post('url');
			return true; // 或者根据逻辑返回false
		},
		choose_id(id) {
			this.choose_rm = id;
		},

		// 登录判断
		islogin() {
			uni.showModal({
				title: '登录提示',
				content: '该功能需要登录后使用。',
				confirmText: '去登录',
				success: function(res) {
					if (res.confirm) {
						uni.navigateTo({
							url: '/pages/login/login'
						});
					} else if (res.cancel) {
						console.log('用户点击取消');
					}
				}
			});
			return;
		},

		format(val) {
			return val + '%';
		},
		handleRangeChange(e) {
			this.rangeValue = e;
		},
		//获取数据
		getHomeData: function() {
			let opts = {
				way: true, //true JSON请求；false 表单请求
				method: 'post',
				url: 'index/home'
			};
			let data = {};
			this.http.httpTokenRequest(opts, data).then(res => {
				//打印请求返回的数据
				console.log(res);
				this.noSheNoChooseImg = res.data.noSheNoChooseImg;
				if (res.code == '200') {
					//轮播图数据
					if (res.data.banners) {
						this.slideShowList = res.data.banners;
					}
					//公告
					if (res.data.notices) {
						this.noticeList = [];
						for (let i = 0; i < res.data.notices.length; i++) {
							this.noticeList.push(res.data.notices[i].title);
						}
					}
					//金刚区
					if (res.data.headBusiness) {
						this.classifyList = [];
						this.classifyList = res.data.headBusiness;
					}

					//未读消息
					this.messageCount = res.data.messages;
				} else {
					this.$refs.uToast.show({
						title: res.message,
						type: 'error'
					});
				}
			});
		},
		//获取业务数据
		getBusinessData: function() {
			let opts = {
				way: true, //true JSON请求；false 表单请求
				method: 'post',
				url: 'index/business'
			};
			let data = {};
			this.http.httpTokenRequest(opts, data).then(res => {
				//打印请求返回的数据
				console.log(res);
				if (res.code == '200') {
					for (let i = 0; i < res.data.length; i++) {
						switch (res.data[i].displayType) {
							case 1:
								this.oneList = res.data[i];
								break;
							case 2:
								this.towList = res.data[i];
								break;
							case 3:
								this.threeList = res.data[i];
								break;
							case 4:
								this.fourList = res.data[i];
								break;
							default:
								break;
						}
					}
				} else {
					this.$refs.uToast.show({
						title: res.message,
						type: 'error'
					});
				}
			});
		},
		jumpToBanner: function(item) {
			if (!this.token) {
				this.islogin();
				return;
			}

			switch (item.redirectType) {
				case 1:
					//非她莫属
					uni.navigateTo({
						url: '../../pageageA/home/matching/matching'
					});
					break;
				case 2:
					//保姆列表
					uni.navigateTo({
						url: '/pageageA/home/almightyNanny/almightyNanny?titleName=' + item.remark + '&redirectId=' + item.redirectUrl
					});
					break;
				case 3:
					//跳转服务
					// uni.switchTab({
					// 	url: "../service/service?classifyId=" + item.redirectUrl
					// });
					//跳转二级分类页
					uni.switchTab({
						url: 'pages/service/service'
					});

					break;
				case 4:
					//一键匹配
					uni.navigateTo({
						url: '../../pageageA/service/matching/matching?chargeType=' + item.chargeType + '&businessId=' + item.redirectUrl
					});
					break;
				case 5:
					//家政人员简历
					uni.navigateTo({
						url: '../../pageageA/home/matching/hisResume/hisResume?resumeId=' + item.redirectUrl
					});
					break;

				case 6:
					//跳转文章
					// uni.navigateTo({
					// 	url: "../../pageageA/home/externalPage/externalPage?url=" + item.redirectUrl
					// });
					//跳转公众号
					// uni.navigateTo({
					// 	url: item.redirectUrl
					// });
					if (item.redirectUrl.includes('https://') || item.redirectUrl.includes('http://')) {
						location.href = item.redirectUrl;
					} else {
						location.href = 'https://${item.redirectUrl}';
					}

					break;
				case 7:
					//跳转文章
					if (item.redirectUrl.includes('https://') || item.redirectUrl.includes('http://')) {
						location.href = item.redirectUrl;
					} else {
						location.href = 'https://${item.redirectUrl}';
					}
					// uni.navigateTo({
					// 	url: "../../pageageA/home/externalPage/externalPage?url=" + item.redirectUrl
					// });
					break;

				default:
					break;
			}
		},
		//点击金刚区跳转页面
		gojump(item) {
			if (!this.token) {
				this.islogin();
				return;
			} else {
				switch (item.redirectType) {
					case 1:
						//非她莫属
						uni.navigateTo({
							url: '../../pageageA/home/matching/matching?serviceType=' + item.redirectId
						});
						break;
					case 2:
						//保姆列表
						uni.navigateTo({
							url: '../../pageageA/home/almightyNanny/almightyNanny?titleName=' + item.name + '&redirectId=' + item.redirectId
						});
						break;
					case 3:
						//跳转服务
						// uni.switchTab({
						// 	url: "../service/service?classifyId=" + item.redirectUrl
						// });
						//跳转二级分类页
						uni.switchTab({
							url: 'pages/service/service'
						});
					case 4:
						uni.navigateTo({
							url: '../../pageageA/service/matching/matching?businessId=' + item.redirectId + '&chargeType=' + item.chargeType
						});
						break;
					case 6:
						//公众号
						// uni.navigateTo({
						// 	url: '../../pageageA/service/matching/matching?businessId=' + item.redirectId + '&chargeType=' + item.chargeType
						// });
						if (item.redirectUrl.includes('https://') || item.redirectUrl.includes('http://')) {
							location.href = item.redirectUrl;
						} else {
							location.href = 'https://${item.redirectUrl}';
						}

						break;
					default:
						break;
				}
			}
		},
		jumpToBusiness: function(item) {
			if (!this.token) {
				this.islogin();
				return;
			} else {
				switch (item.redirectType) {
					case 1:
						//非她莫属
						uni.navigateTo({
							url: '../../pageageA/home/matching/matching?businessId=' + item.redirectBusinessId
						});
						break;
					case 2:
						console.log(item);
						//一键匹配
						// uni.navigateTo({
						// 	url:'../../pageageA/service/serviceDetail?titleName=' + item.name + '&redirectId=' + item.redirectBusinessId+'&chargeType='+item.chargeType
						// })
						uni.navigateTo({
							url: '../../pageageA/service/matching/matching?businessId=' + item.redirectBusinessId + '&chargeType=' + item.chargeType
						});
						break;
					default:
						break;
				}
			}
		},
		mescrollInit(mescroll) {
			this.mescroll = mescroll;
		},
		// 下拉刷新回调函数
		downCallback() {
			setTimeout(() => {
				this.mescroll.endSuccess();
				this.getLocationInfo();
				this.getHomeData();
				this.getBusinessData();
				this.page = 1;
				this.shopList = [];
				this.prompt = '加载中....';
				this.getShop();
			}, 2000);
		},
		lower(e) {
			console.log(e + '652');
			if (this.totalPage == this.page) {
				return false;
			} else {
				this.page += 1;
				// this.page = 1;
				this.getShop();
			}
		},
		getLocationInfo() {
			var _this = this;
			uni.getStorage({
				key: 'siteName',
				success: res => {
					console.log(res);
					this.siteName = res.data;
				},
				fail: resd => {
					console.log(resd);
					//2. 获取地理位置
					uni.getLocation({
						type: 'wgs84',
						success(res) {
							// console.log("你当前经纬度是：");
							console.log(res);
							let latitude, longitude;
							latitude = res.latitude.toString();
							longitude = res.longitude.toString();
							var that = this;
							var myAmapFun = new amap.AMapWX({
								key: _this.http.mapVxKey
							});
							myAmapFun.getRegeo({
								location: '' + longitude + ',' + latitude + '', //location的格式为'经度,纬度'
								success: function(e) {
									_this.siteName = e[0].regeocodeData.addressComponent.city; //城市
									uni.setStorage({
										key: 'siteName',
										data: e[0].regeocodeData.addressComponent.city
									});
								},
								fail: function(info) {
									console.log('失败');
								}
							});
						}
					});
				}
			});
		},
		//跳转选择城市
		jumpToSelectCity: function() {
			if (!this.token) {
				this.islogin();
				return;
			} else {
				uni.navigateTo({
					url: '/pageageA/home/selectCity/selectCity?cityName=' + this.siteName
				});
			}
		},
		//跳转公告
		jumpToNoticeList: function() {
			// this.islogin();

			if (!this.token) {
				this.islogin();
				return;
			} else {
				uni.navigateTo({
					url: '../../pageageA/home/noticeList/noticeList'
				});
			}
		},
		//跳转非她莫属
		jumpToMatching: function() {
			// this.islogin();
			if (!this.token) {
				this.islogin();
				return;
			} else {
				uni.navigateTo({
					url: '../../pageageA/home/matching/matching'
				});
			}
		},
		//跳转消息
		jumpToInfomation: function() {
			// this.islogin();
			if (!this.token) {
				this.islogin();
				return;
			} else {
				uni.navigateTo({
					url: '../../pageageA/home/information/information'
				});
			}
		},
		// 获取附近商家
		getShop() {
			var _this = this;
			let opts = {
				way: true, //true JSON请求；false 表单请求
				method: 'post',
				url: 'index/nearEnt'
			};
			if(typeof(_this.siteName) !== "string"){
				_this.siteName="郑州"
			}
			let data = {
				city:_this.siteName == "" || !_this.siteName?'郑州':_this.siteName,
				page: _this.page,
				pageSize: _this.pageSize
			};
			_this.http.httpTokenRequest(opts, data).then(res => {
				// uni.hideLoading();
				if (res.code == 200) {
					this.totalPage = res.data.pages;
					if (res.data.records.length > 0 || _this.page != 1) {
						_this.showList = false;
						if (res.data.current * res.data.size < res.data.total) {
							for (const key in res.data.records) {
								_this.shopList.push(res.data.records[key]);
							}
							_this.prompt = '加载中....';
						} else {
							for (const key in res.data.records) {
								_this.shopList.push(res.data.records[key]);
							}
							_this.prompt = '没有更多了';
						}
					} else {
						_this.showList = true;
						_this.shopList = [];
					}
				} else {
					_this.$refs.uToast.show({
						title: res.message,
						type: 'error'
					});
				}
			});
		},
		//跳转商家详情
		shopDetail(enterpriseId) {
			if (!this.token) {
				this.islogin();
				return;
			} else {
				uni.navigateTo({
					url: '../../pageageA/home/shopDetails/shopDetails?enterpriseId=' + enterpriseId
				});
			}
		}
	}
};
</script>

<style scoped lang="scss">
.city {
	position: sticky;
	z-index: 990;
	top: 60rpx;
	left: 47rpx;
}
.choose_1 {
	color: white;
	background-color: #ff9c64;
	background: linear-gradient(135deg, transparent 57rpx, #ff9c64 0); //切角效果
	// border-radius:100rpx 30rpx 0rpx 0rpx;
	border-top-right-radius: 20rpx;
}
.choose_2 {
	color: #6b6b6b;
}
.heard_bg {
	width: 100%;
	height: 634rpx;
	background-image: url(https://beedao.oss-cn-beijing.aliyuncs.com/aefecf18722e4d5e9a3dcd1b70a09ab2.png);
	background-size: 100% 100%;
	background-repeat: no-repeat;
}
.leftTest {
	font-size: 30rpx;
	font-family: PingFang SC;
	font-weight: bold;
	color: #3f3f3f;
	opacity: 1;
	margin-right: 10rpx;
	width: 200rpx;
}
.slideshow {
	height: 352rpx;
	border-radius: 20rpx;
	// margin-bottom: 24rpx;
}
swiper image {
	width: 100%;
	height: 100%;
	// border-radius: 20rpx;
}

.classify-img {
	width: 118rpx;
	height: 118rpx;
	border-radius: 50%;
}

.classify-text {
	font-size: 28rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #000000;
	opacity: 1;
	margin-top: -8rpx;
	margin-bottom: 10rpx;
}

.information {
	position: fixed;
	z-index: 2;
	top: 478rpx;
	right: 5rpx;
}

.sa_bottoms {
	padding: 26rpx 0rpx 0rpx 0rpx;
	border-top: 2rpx solid #e8e8f6;
}

.tables {
	// margin: 0rpx 16rpx;
	// margin-top: 20rpx;
	height: auto;
	// width: 92%;
	// margin: auto;
	background: #ffffff;
	// box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.16);
	// opacity: 1;
	// border-radius: 20px;
}

.typeface1 {
	font-size: 38rpx;
	font-family: ZHSCNMT-GBK;
	font-weight: 500;
	color: #3f3f3f;
	opacity: 1;
	margin-left: 14rpx;
}

.more {
	font-size: 28rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #f29423;
	opacity: 1;
}

.typeface2 {
	font-size: 36rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #3f3f3f;
	opacity: 1;
}

.typeface3 {
	font-size: 22rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #979797;
	opacity: 1;
}

.warp {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
}

.top {
	margin-left: 30rpx;
	padding-top: 10rpx;
	display: flex;
	align-items: center;
}

.top image {
	width: 34rpx;
	height: 34rpx;
	vertical-align: middle;
	margin-left: 20rpx;
}

.unit {
	padding: 20rpx 0rpx 10rpx 0rpx;
	width: 100%;
	margin: auto;
}

.unit1 {
	// display: flex;
	padding-bottom: 24rpx;
	// border-bottom: 1px solid #e8e8f6;
}

.unit1 .img {
	width: 122rpx;
	height: 122rpx;
	background: #e4e4e4;
	opacity: 1;
}

.unit1 .shop {
	// width: 78%;
	// margin-left: 18rpx;
}

.shop .all {
	display: flex;
	// justify-content: space-between;
	align-items: flex-start;
}

.shop .all .nam {
	font-size: 30rpx;
	color: #3f3f3f;
	font-weight: 500;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.shop .all .year {
	width: 160rpx;
	height: 36rpx;
	background: #fff2d9;
	border: 1px solid #f29423;
	opacity: 1;
	border-radius: 10rpx 0px 10rpx 0px;
	font-size: 22rpx;
	color: #f29423;
	text-align: center;
	margin-left: 16rpx;
}

.bott {
	display: flex;
	justify-content: space-between;
	color: #9393aa;
	font-size: 26rpx;
	margin-top: 14rpx;
}

.service {
	display: flex;
	align-items: center;
}

.service image {
	width: 29rpx;
	height: 27rpx;
}

.service view {
	padding-left: 10rpx;
}

.unit2 {
	// display: flex;
}

.unit2 .white {
	width: 122rpx;
}

.sales {
	// width: 78%;
	// border-bottom: 2rpx solid #e8e8f6;
	padding: 14rpx 0 14rpx 0rpx;
}

.hour {
	font-size: 26rpx;
	color: #9393aa;
	display: flex;
	align-items: center;
}

.hour .tao {
	color: #f29423;
	font-size: 20rpx;
	border: 1px solid #f29423;
	text-align: center;
	margin-left: 16rpx;
	padding: 0 8rpx;
	height: 28rpx;
	line-height: 26rpx;
}

.money {
	width: 100%;
	display: flex;
	justify-content: space-between;
	margin-top: 4rpx;
}

.money .sale {
	display: flex;
	font-size: 26rpx;
}

.sale .price {
	color: #f29423;
}

.sale .prices {
	// text-decoration: line-through;
	font-size: 20rpx;
	color: #ceced1;
	// margin-left: 12rpx;
}

.over {
	color: #9393aa;
	font-size: 26rpx;
}
// tabberyangshi







</style>
